import { defineConfig } from '@vben/vite-config';
import path from 'path';

console.log('out dir:', path.resolve(__dirname, '../../../../out/renderer'));

export default defineConfig(async () => {
  return {
    application: {},
    vite: {
      base: './',
      server: {
        proxy: {
          '/api': {
            changeOrigin: true,
            rewrite: (path) => path.replace(/^\/api/, ''),
            // mock代理目标地址
            target: 'http://localhost:5320/api',
            ws: true,
          },
        },
      },
      build: {
        assetsDir: './assets',
        // outDir: path.resolve(__dirname, '../../../../out/renderer'),
        emptyOutDir: true,
      },
    },
  };
});
